<?php
require_once './application/core/CoreBase.php';
require_once './library/XML/xmlToObjArray.php';
require_once './application/entity/sonde/confdata.php';

class readConf extends IndexCore
{
    private $_conf;
    private $_obj;
    private $_node;
    private $_data;

    public function readConfXML( $xml )
    {
        $this->_conf = $xml;
        $this->_obj = new xmlToObjArray();
        $this->_conf = $this->_obj->XMLToArray( $this->_conf );
        $this->_obj = new confData();
        foreach( $this->_conf as $k => $v )
        {
            foreach ( $v as $n => $c )
            {
                if ( is_array($c) == false )
                    $this->_node[$n] = $c;
            }
            $this->_data[$k] = $this->_node;
            unset( $this->_node );
        }
        $this->_obj->data = $this->_data;
        return $this->_obj;
    }

}
